package ch.rheintalconnection.sysventory.application;

import java.util.HashMap;

import ch.rheintalconnection.sysventory.domain.ScanEntry;

public class PCDatas extends HashMap<PCAttribute, Object> {

	private static final long serialVersionUID = 5965361417976483263L;

	public PCDatas(ScanEntry scanEntry){
		mapData(scanEntry);
	}
	
	private void mapData(ScanEntry scanEntry){
		
		this.put(PCAttribute.Client, scanEntry.getClient());
		this.put(PCAttribute.ScanDate, scanEntry.getScandate());
		
		this.put(PCAttribute.OSName, scanEntry.getOs().getDescription());
		this.put(PCAttribute.OSVersion, scanEntry.getOs().getVersion());
		this.put(PCAttribute.OSTechnology, scanEntry.getOs().getTechnology());
		
		this.put(PCAttribute.Programs, scanEntry.getPrograms());
		
		this.put(PCAttribute.CPUDesc, scanEntry.getProcessor().getDescription());
		this.put(PCAttribute.CPUFamily, scanEntry.getProcessor().getFamily());
		this.put(PCAttribute.CPUCores, scanEntry.getProcessor().getCores());
		this.put(PCAttribute.CPUClockrate, scanEntry.getProcessor().getClockrate());
		
		this.put(PCAttribute.Printers, scanEntry.getPrinters());
		
		this.put(PCAttribute.PCName, scanEntry.getComputer().getComputerName());
		this.put(PCAttribute.PCRAM, scanEntry.getComputer().getRam());
		this.put(PCAttribute.PCType, scanEntry.getComputer().getComputerType());
		String sHarddisk = "Speicher Total: " + scanEntry.getComputer().getHdCapacity() + "\n\r";
		sHarddisk += "Speicher belegt: " + scanEntry.getComputer().getHdOccupied();
		this.put(PCAttribute.PCHD, sHarddisk);

		
		this.put(PCAttribute.NICIP, scanEntry.getNic().getIpAddress());
		this.put(PCAttribute.NICMacAddress, scanEntry.getNic().getMacAddress());
		this.put(PCAttribute.NICDesc, scanEntry.getNic().getDescription());
		this.put(PCAttribute.NICGateway, scanEntry.getNic().getGateway());
		this.put(PCAttribute.NICDHCP, scanEntry.getNic().getDhcp());
		this.put(PCAttribute.NICSubnet, scanEntry.getNic().getSubNet());
	}
	
}
